/***************************************************************************
 *   Copyright (C) 2009 by Marcin Swiechowicz   *
 *   marcin.swiechowicz@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef THUMBNAILSWIDGET_H
#define THUMBNAILSWIDGET_H

#include <QWidget>
#include <kdcmovie.h>
#include <QGraphicsView>
#include <KIntNumInput>
#include <KComboBox>
#include <QProgressBar>
#include <QRadioButton>
#include <KJob>
#include <QPair>
#include "framecombobox.h"
#include <interfaces/kdcframejobinterface.h>

class ThumbnailsWidget: public QWidget
{
Q_OBJECT
public:
	ThumbnailsWidget( KDCMovie *aMovie, QWidget *aParent = 0 );
	~ThumbnailsWidget();
private slots:
	void generate();
	void save();
	void abort();
	void slotResult( KJob *aJob );
private:
	void prepareScene( int aThumbCount, int aPicWidth, int aPicHeight );
	void clear();
	void addThumbs( int aPos, const QPixmap &aPic );
	int thumbsPerRow() const;
private:
	KDCMovie *pMovie;
	QGraphicsView *pView;
	KIntNumInput *pNumThumbs;
	KIntNumInput *pTimeThumb;
	FrameComboBox *pDecorationCombo;
	KComboBox *pSchemeCombo;
	QProgressBar *pProgress;
	QRadioButton *pNumRadio;
	QRadioButton *pTimeRadio;
	QList<QPair<int,KDCFrameJobInterface*> > pThumbJobs;
	int pItemCount;
};
#endif
